
#include <xpo/bas/Object.h>
#include <xp/bas/stdio.h>

@interface Child: XpObject
{
	int a;
}

- (id) init;
- (void) print;
- (void) dealloc;
@end

@implementation Child
- (id) init
{
	[super init];
	a = 2871;
	return self;
}

- (void) print
{
#ifdef __APPLE__
	xp_printf (XP_TEXT("print a in [%S] -> [%d]\n"), 
		((struct objc_class*)self)->isa->name, a);
#else
	xp_printf (XP_TEXT("print a in [%S] -> [%d]\n"), 
		object_get_class_name(self), a);
#endif
}

- (void) dealloc
{
	xp_printf (XP_TEXT("deallocating...\n"));	
}
@end

int xp_main ()
{
	id t;

	t = [Child new];
	[t print];
	[t dealloc];
	return 0;
}
